//
//  LoginUserManager.m
//  YellowBridge
//
//  Created by 王右 on 2018/12/6.
//  Copyright © 2018 王右. All rights reserved.
//

#import "LoginUserManager.h"

@implementation LoginUserManager

+ (LoginUserManager *)sharedManager{
    static LoginUserManager *manager;
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        manager = [[LoginUserManager alloc] init];
    });
    return manager;
}

- (NSString *)account{
    return self.currentUser.account;
}

- (NSString *)password{
    return self.currentUser.password;
}

- (NSString *)signtoken{
    return self.currentUser.signtoken;
}

- (LoginUserModel *)currentUser{
    LoginUserModel *model = [[CCCache defaultManager] objectForKey:Login_User_Info_Model];
    return model;
}

- (BOOL )isProjectManager{
    return [self.currentUser.usertype isEqualToString:@"2"];
}

- (NSArray *)creatProjectArr{
    return self.currentUser.pmauth;
}

- (BOOL)isCreater:(NSString *)createById{
    NSString *userId = self.currentUser.userid;
    return [userId isEqualToString:createById];
}

@end
